/*
 * @Author: 蔡继周
 * @Date: 2021-11-09 21:34:28
 * @LastEditTime : 2021-12-16 15:03:49
 * @LastEditors  : Shaquille.Cai
 * @Description: I have to do something...
 * @FilePath     : \\vue3-admin-with-blog\\vite.config.js
 */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const path = require('path')

// https://vitejs.dev/config/
export default defineConfig({
    resolve: {
        alias: {
            '@': path.resolve(__dirname, './src')
        }
    },
    server: {
        host: '0.0.0.0',
        port:8888,
        proxy: {
            "/api": {
                target: "http://localhost:1818",
                rewrite: path => path.replace(/^\/api/, ''),
                changeOrigin: true,
            }
        }
    },
    plugins: [vue()]
})